<template>
	<view class="page">
		<customtop top_title="订单列表"></customtop>
		<view class="order_list" v-if="!loading">
			<view class="">
				<view class="pagebox topinfo">
          <view class="name">{{abb.title}}</view>
					<view class="price price_color">加盟费：¥{{abb.jiamengfei}}</view>
				</view>

        <view class="items" v-if="orders.length > 0">
          <view class="item" v-for="(item, index) in orders" :key="index" @click="jumpPage('/pages/abb/order_show_shop?id=' + item.id)">
            <view class="item_top">
              订单编号：{{item.id}}
            </view>
            <view class="item_con">
              <view class="">用户：{{item.user_nickname}}</view>
              <view class="">进度：{{item.node_str.name}}</view>
              <view class="">创建时间：{{item.created_at}}</view>
            </view>
          </view>
        </view>
        <view :style="{ marginTop: '30px' }" v-if="orders.length == 0">
          <u-empty
            mode="data"
            icon="http://cdn.uviewui.com/uview/empty/data.png"
            text="暂无报名人员~"
          >
          </u-empty>
        </view>

				</view>
			</view>
		</view>

	</view>
</template>

<script>
import { request, upload } from "@/utils/http.js"
import customtop from "@/components/customtop.vue"
export default {
	components: { customtop },

	data() {
		return {
      loading: true,
      abb: {},
      orders: {},
    }
	},

	onLoad(options) {
    this.abb_id = options.abb_id;
    request.post('/abb/getAbb', {id: this.abb_id}).then(res => {
      this.loading = false;
      this.abb = res.data.abb;
    })

    uni.showLoading();
    this.getOrders();
	},

	methods: {
    getOrders: function() {
      request.post('/abb/getOrders', {abb_id: this.abb_id}).then(res => {
        uni.hideLoading();
        this.loading = false;
        this.orders = res.data;
      })
    },

		switchTab: function(url) {
			uni.switchTab({ url: url });
		},

		jumpPage: function(url) {
			uni.navigateTo({ url: url })
		}
	}
}
</script>

<style>
@import url("abb.css");
.page {
	padding-bottom: 30rpx;
}
</style>
